package com.liyiruo.testMain;

import com.alibaba.druid.pool.DruidDataSource;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import java.sql.Connection;
import java.sql.DriverManager;

/**
 * @author liyiruo
 * @Description
 * @Date 2023/4/18 下午11:37
 */
public class DataSourceTest {
    public static void main(String[] args) {
        ApplicationContext context=new ClassPathXmlApplicationContext("datasource.xml");
        Object bean = context.getBean("connection");
        Object bean2 = context.getBean("dataSource");
        System.out.println(bean);
        System.out.println(bean2);


    }
}
